<template>
	<view class="film-page">

		<view class="film-info-box" :style="{background:`url(${filmInfo.Imageurl})`}">
			<view class="bg-blur">
				<view class="film-info">
					<view class="film-info-top">
						<view>
							<image :src="filmInfo.Imageurl" mode=""></image>
						</view>
						<view class="info-text">
							<text>{{filmInfo.filmType}}/{{filmInfo.Duration}}分钟</text>
							<br />
							<br />
							<text>{{filmInfo.showType}}</text>
							<br />
							<br />
							<text>{{filmInfo.PublishDate}}中国大陆上映</text>
						</view>
					</view>
					<view style="width: 100vw;">
						<text class="score">{{filmInfo.score}}</text>
						<u-rate v-model='score' readonly allow-half></u-rate>
					</view>
				</view>
			</view>
		</view>
		<view class="introductory">
			<text class="title">简介</text>
			<view class="introductory-txt">
				<text>{{filmInfo.Introduction}}</text>
			</view>
		</view>
		<view class="cast">
			<text class="title">演员表</text>
			<view class="cast-list">
				<text v-for="(item,index) in castList" :key='index'>{{item}}</text>
			</view>
		</view>
		<view class="cast">
			<text class="title">剧照</text>
			<view class="stage-photo">
				<image :src="item" v-for="(item,index) in stagePhoto" :key="index" @click="showPhoto(index)"></image>
				<!-- <image :src="filmInfo.Imageurl" @click="showPhoto" ></image> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				filmInfo: {},
				castList: [],
				score: 0,
				stagePhoto: []
			};
		},
		methods: {
			initData() {
				this.filmInfo = this.$store.state.filmInfo
				this.score = parseFloat(this.filmInfo.score / 2)
				this.castList = this.filmInfo.Cast.split('/')
				// this.stagePhoto = this.filmInfo.stagePhoto.split(',')
				this.stagePhoto.push(this.filmInfo.Imageurl)

			},
			showPhoto(current) {
				uni.previewImage({
					current,
					urls: this.stagePhoto,
				});
			}
		},
		onLoad() {
			this.initData()
			uni.setNavigationBarTitle({
				title: this.$store.state.cinemaName
			})
		}
	}
</script>

<style lang="scss">
	.film-page {
		height: 100vh;
		background-color: #f0f0f5;

		.film-info-box {

			background-size: 100% 100%;
			height: 400rpx;
			z-index: -1;

			.bg-blur {
				background-color: rgba(255, 255, 255, 0.3);
				backdrop-filter: blur(10px);
				width: 100%;
				height: 100%;
				display: flex;

				z-index: -1;

				.film-info {
					background-color: #fff;
					width: 100vw;
					border-radius: 20rpx 20rpx 0 0;
					height: 360rpx;
					margin-top: 250rpx;


					.film-info-top {
						display: flex;

						image {
							width: 200rpx;
							height: 300rpx;
							border-radius: 10rpx;
							margin: -130rpx 30rpx 0 30rpx;
						}
					}

					.info-text {
						color: #999;
						height: 200rpx;

						text {
							margin-top: 10rpx;
						}
					}

					.score {
						font-size: 36px;
						margin-left: 40rpx;
						font-weight: bold;
						color: #F0AD4E;
					}

				}

			}


		}

		.introductory {
			background-color: #fff;
			margin-top: 220rpx;
			padding: 15rpx 30rpx;

			.title {
				border-bottom: 1px solid #f0f0f5;
				width: 100%;
				display: block;
				padding-bottom: 15rpx;

			}

			.introductory-txt {
				margin-top: 20rpx;
				font-size: 28rpx;
				text-indent: 40rpx;
				color: #999;
			}
		}

		.cast {
			background-color: #fff;
			margin-top: 20rpx;
			padding: 15rpx 30rpx;

			.title {
				border-bottom: 1px solid #f0f0f5;
				width: 100%;
				display: block;
				padding-bottom: 15rpx;

			}

			.cast-list {
				margin-top: 20rpx;
				font-size: 28rpx;
				color: #999;
				padding: 0 20rpx;
				display: flex;

				flex-wrap: wrap;

				text {
					margin-right: 30rpx;
				}
			}
		}

		.stage-photo {
			display: flex;
			flex-wrap: wrap;

			image {
				width: 165rpx;
				height: 165rpx;
				margin: 5rpx;
			}
		}
	}
</style>